package test;

public class Teacher {
    private String id;         // 教师编号
    private String name;       // 姓名
    private String gender;     // 性别
    private Course taughtCourse; // 所授课程

    // 构造方法
    public Teacher(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    // 教师开课方法
    public void openCourse(Course course) {
        this.taughtCourse = course;
        System.out.println("教师" + name + "成功开设课程《" + course.getName() + "》");
    }

    // Getter方法
    public String getId() { return id; }
    public String getName() { return name; }
    public Course getTaughtCourse() { return taughtCourse; }
}
